package com.chen.q1.aop;

import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.*;

@Aspect
public class Aop2 {

    @Pointcut(value = "execution(* com.chen.q1.business.Klass.setUpKlass())")
    public void pointCut(){}

    @Before(value = "pointCut()")
    public void before(){
        System.out.println("--------->begin klass setUpKlass.....");
    }

    @After(value = "pointCut()")
    public void after(){
        System.out.println("--------->after klass setUpKlass.....");
    }

    @Around(value = "pointCut()")
    public void around(ProceedingJoinPoint joinPoint){
        System.out.println("----->around begin klass setUpKlass-------");
        try {
            joinPoint.proceed();
        } catch (Throwable throwable) {
            throwable.printStackTrace();
        }
        System.out.println("----->around finish klass setUpKlass-------");

    }
}
